<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<button id="btn" type="button">关闭本页面</button>
<body>
<script type="text/javascript">
        onload=()=>{
            let btn=document.querySelector('#btn');
            btn.onclick=()=>close();
        };

</script>
</body>
</html>